package com.cloudsigns.factorymanager2.project.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.cloudsigns.factorymanager2.R;
import com.cloudsigns.factorymanager2.engineering.activity.CreateEngineeringOrderListActivity;
import com.cloudsigns.factorymanager2.project.activity.BackupOrderListActivity;
import com.cloudsigns.factorymanager2.project.activity.DesignContactOrderListActivity1;
import com.cloudsigns.factorymanager2.project.activity.ProductionTaskOrderListActivity;

/**
 * Created by tony on 2018/8/5.
 */

public class ProjectOrderListFragment extends Fragment implements View.OnClickListener {
    private View rl_shejilianxi;
    private View rl_shengchanrenwu;
    private View rl_gongchenggongdan;
    private View rl_beikudan;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_project_order_list, null);
        rl_shejilianxi=view.findViewById(R.id.rl_shejilianxi);
        rl_shengchanrenwu=view.findViewById(R.id.rl_shengchanrenwu);
        rl_gongchenggongdan = view.findViewById(R.id.rl_gongchenggongdan);
        rl_beikudan=view.findViewById(R.id.rl_beikudan);


        rl_shejilianxi.setOnClickListener(this);
        rl_shengchanrenwu.setOnClickListener(this);
        rl_gongchenggongdan.setOnClickListener(this);
        rl_beikudan.setOnClickListener(this);


        return view;
    }

    @Override
    public void onClick(View view) {
        Intent mIntent;
        switch (view.getId()) {
            // 设计联系单
            case R.id.rl_shejilianxi:
                mIntent = new Intent(getActivity(), DesignContactOrderListActivity1.class);
                startActivity(mIntent);
                break;
                // 生产任务单
            case R.id.rl_shengchanrenwu:
                mIntent = new Intent(getActivity(), ProductionTaskOrderListActivity.class);
                startActivity(mIntent);
                break;
            // 工程工单
            case R.id.rl_gongchenggongdan:
                mIntent = new Intent(getActivity(), CreateEngineeringOrderListActivity.class);
                startActivity(mIntent);
                break;
            // 备库单
            case R.id.rl_beikudan:
                mIntent = new Intent(getActivity(), BackupOrderListActivity.class);
                startActivity(mIntent);
                break;
        }
    }
}

